/**
  ETFRoot project, Anyang Normal University && IMP-CAS
  \class ETFDCTa
  \brief for DCs around the target
  \author SUN Yazhou, asia.rabbit@163.com
  \since 2021-10-28
  \date 2021-11-21 last modified
  \attention
  changelog
  <table>
  <tr>  <th>Date         <th>Author      <th>Description                   </tr>
  <tr>  <td>2021-10-28   <td>Asia Sun    <td>file created                  </tr>
  </table>

  \copyright Copyright (c) 2021 Anyang Normal U. && IMP-CAS with LGPLv3 LICENSE
*/

#ifndef ETFDCTa_h
#define ETFDCTa_h

#include "ETFVDC.h"

class TClonesArray;
class ETFDCHit;

class ETFDCTa : public ETFVDC{
public:
  ETFDCTa(){}
  ETFDCTa(const char *name);
  virtual ~ETFDCTa();

  virtual void Initialize(); ///< initialize the detector
  virtual void DrawHits(); ///< draw the hits
  /// set the wire's projection to its normal plane
  virtual void SetHitProjection(ETFDCHit *h, DCType typeDC);
  virtual void Register(); ///< register hits to the main output tree

  /// get the fired sense wire layer
  /// \param type: XUV or XY, DC type; x12: X1 or X2
  virtual TClonesArray *GetHitsArray(DCType type, int x12);
  virtual void Print(); ///< print the detector info

  ClassDef(ETFDCTa, 1);

protected:
  /// \param wireId: 0-16 (or 32) (both x1 and x2), along x increasing direction
  /// \param xy: 0-1
  virtual void AddHit(const ETFHPTDCChannel *ch, int wireId, DCType xy) = 0;
  /// fill the channel map for X or Y wires
  virtual void FillXYChMap(int chId0) = 0;

  ///@{ the six layers of fired sense wires
  TClonesArray *fHits[2][2];  //-> ///< [xy][x1-x2]
  ///@}
  /// uid prefix, just for generation of UID
  /// definition of UID: [0-7]: detId; [8-9]: X-U-V-Y; [10]: X1-X2; [11-17]: wireId
  unsigned type[3]; ///< XY, X1-X2, senseWireId
};

#endif
